<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="/template/principal.xhtml">
        <ui:define name="conteudo">
            <h:form>
                <p:panel header="Escolha os Tecnicos da Equipe: #{equipe.novaequipe.nome}">
                    <p:messages globalOnly="true"/>
                    <p:tabView >
                        <p:tab title="Lista de Tecnico" >
                            <p:dataTable value="#{tecnico.listaTecnicos}" var="t" rows="10" dynamic="false" paginator="true" 
                                         selectionMode="multiple" selection="#{equipe.tecnicos}" emptyMessage="Nenhum Tecnico cadastrado nesta equipe">
                                <p:column headerText="Nome" style="width: 30%"  filterBy="#{t.nome}">
                                        <h:outputText value="#{t.nome}"/>
                                </p:column>
                                <p:column headerText="Funcao" style="width: 30%">
                                    <h:outputText value="#{t.fkFuncao.descricao}"/>
                                </p:column>
                                <p:column headerText="Telefone" style="width: 20%">
                                    <h:outputText value="#{t.telefone}"/>
                                </p:column>
                            </p:dataTable>
                            <br/>
                            <p:commandButton value="Salvar equipe" action="#{equipe.salvarTecnicos}" ajax="false"/>
                        </p:tab>
                    </p:tabView>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>